public class Liczba2	{
	private String liczba;
	public int decimal;
	public int base;
	
	Liczba2(int decimal, int base)	{
		liczba = Integer.toString(decimal, base);
		this.decimal = decimal;
		this.base = base;
	}
	public String changeBase(int base)	{
		if(base <= 0)	{
			return null;
		}
		else	{
			this.base = base;
			updateField();
			return liczba;
		}
		
	}
	public String changeDecimal(int decimal)	{
		if(decimal <= 0)	{
			return null;
		}
		else	{
			this.decimal = decimal;
			updateField();
			return liczba;
		}
	}
	@Override
	public String toString()	{
		return liczba;
	}
	public void updateField()	{
		liczba = Integer.toString(decimal, base);
	}
}

